<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>window对象</title>
		
	</head>
	<body>
		<p id="timer"></p>
		
		<script>
			//解决方案1
			window.document.getElementById("timer").innerHTML=new Date().toLocaleString();		
		</script>
	</body>
</html>